﻿#nullable enable

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PHMEE.EnergyEfficiency;

    /// <summary>
    /// AMS 模拟量消息的单位
    /// </summary>
    public enum AmsXdrUnitType
    {
        #region AMS

        /// <summary>
        /// 未知
        /// </summary>
        [Description("UnKnown")] 
        Unknown = 0,

        /// <summary>
        /// // 摄氏度，C
        /// </summary>
        [Description("℃")] 
        Celsius = 1,

        /// <summary>
        /// 压力单位，bar
        /// </summary>
        [Description("Bar")] 
        Bar = 2,

        #endregion AMS

        // #region 轴功率计
        //
        // /// <summary>
        // /// 转速
        // /// </summary>
        // [Description("rpm")] 
        // Rpm = 3,
        //
        // /// <summary>
        // /// 千牛·米
        // /// </summary>
        // [Description("kNm")] 
        // KNm = 4,
        //
        // /// <summary>
        // /// 千瓦
        // /// </summary>
        // [Description("kW")] 
        // KW = 5,
        //
        // /// <summary>
        // /// 转数
        // /// </summary>
        // [Description("revolutions")] 
        // Revolutions = 6,
        //
        // /// <summary>
        // /// 千瓦时
        // /// </summary>
        // [Description("kWh")] 
        // KWh = 7,
        //
        // #endregion 轴功率计
    }

    public static class AmsXdrUnitTypeExtensions
    {
        public static string ToDisplayString(this AmsXdrUnitType type)
        {
            return type switch
            {
                AmsXdrUnitType.Celsius => "℃",
                AmsXdrUnitType.Bar => "Bar",
                // AmsXdrUnitType.Rpm => "rpm",
                // AmsXdrUnitType.KNm => "kNm",
                // AmsXdrUnitType.KW => "kW",
                // AmsXdrUnitType.Revolutions => "revolutions",
                // AmsXdrUnitType.KWh => "kWh",
                _ => "UnKnown"
            };
            
        }
    }
